using System;
using System.Text;
using System.Collections.Generic;
using iBeauty.BusinessObjects;
using iBeauty.DAL;

namespace iBeauty.BLL
{
	public class ProductGroupBLL
	{
		private ProductGroupDAO _ProductGroupDAO;

		public ProductGroupDAO ProductGroupDAO
		{
			get { return _ProductGroupDAO; }
			set { _ProductGroupDAO = value; }
		}

		public ProductGroupBLL()
		{
			ProductGroupDAO = new ProductGroupDAO();
		}
		public List<ProductGroup> GetProductGroups()
		{
			try
			{
				return ProductGroupDAO.GetProductGroups();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public ProductGroup GetProductGroup(string ID)
		{
			try
			{
				return ProductGroupDAO.GetProductGroup(ID);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddProductGroup(ProductGroup oProductGroup)
		{
			try
			{
				return ProductGroupDAO.AddProductGroup(oProductGroup);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddProductGroup(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string GroupCode,string GroupName,int? AccountId,string Note)
		{
			try
			{
				return ProductGroupDAO.AddProductGroup(ID,CreateDate,ModifiedDate,TimeStamp,GroupCode,GroupName,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateProductGroup(ProductGroup oProductGroup)
		{
			try
			{
				return ProductGroupDAO.UpdateProductGroup(oProductGroup);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateProductGroup(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string GroupCode,string GroupName,int? AccountId,string Note)
		{
			try
			{
				return ProductGroupDAO.UpdateProductGroup(ID,CreateDate,ModifiedDate,TimeStamp,GroupCode,GroupName,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveProductGroup(ProductGroup oProductGroup)
		{
			try
			{
				return ProductGroupDAO.RemoveProductGroup(oProductGroup);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveProductGroup(string ID)
		{
			try
			{
				return ProductGroupDAO.RemoveProductGroup(ID);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<ProductGroup> DeserializeProductGroups(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<ProductGroup>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeProductGroups(string Path, List<ProductGroup> ProductGroups)
		{
			try
			{
				GenericXmlSerializer<List<ProductGroup>>.Serialize(ProductGroups, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
